package com.kitty.mina.codec;

import com.kitty.mina.codec.xf.WDDecoder;
import com.kitty.mina.codec.xf.v6.WDEncoder;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;


public class MessageCodecFactory implements ProtocolCodecFactory {

    private WDDecoder decoder = new WDDecoder();

    private WDEncoder encoder = new WDEncoder();

    @Override
    public ProtocolEncoder getEncoder(IoSession session) throws Exception {
        return encoder;
    }

    @Override
    public ProtocolDecoder getDecoder(IoSession session) throws Exception {
        return decoder;
    }
}
